<template>
    <div class="activityContentCss">
      <div class="titleCss">{{ title }}</div>
      <div class="msgCss">
        <div class="msgTitle">恭喜您领到了以下福利：</div>
        <template v-for="item in PrizeList">
          <div class="ticketCss" v-if="item.Unit=='积分'">
            <div class="contentLeft"><span class="left">{{ item.Count }}</span><span class="ticketCssRight ticketFontSize14">{{ item.Unit }}</span>
            <br>
            <div class="bottomMsg">{{ item.Remark }}</div>
            </div>
            <div class="ticketCssRight ticketFontSize20 divAlignCenter">{{ item.Title }}</div>
          </div>
          <div class="ticketCss" v-else-if="item.Title=='PLUS会员'">
            <div class="contentLeft"><span class="leftplus">{{ item.Title }}</span>
            <br>
            <div class="bottomMsg">{{ item.Remark }}</div>
            </div>
            <div class="ticketCssRight ticketFontSize20 divAlignCenter">{{ item.Unit }}<i  class="fas dx-icon icon-t-close delectIcon"></i>{{ item.Count }}</div>
        </div>
          <div class="ticketCss" v-else>
            <div class="contentLeft"><span class="left">{{ keepOneDecimal(item.Value,item.Unit) }}</span><span class="ticketCssRight ticketFontSize14">{{ item.Unit }}</span>
            <br>
            <div class="bottomMsg">{{ item.Remark }}</div>
            </div>
            <div class="ticketCssRight ticketFontSize20 divAlignCenter">{{ item.Title }}<i  class="fas dx-icon icon-t-close delectIcon"></i>{{ item.Count }}</div>
        </div>
        </template>
        
        <div class="ticketBottomMsg">福利已发放至{{Telephone}}的T账户<br>请登录T小程序/APP，前往“我-卡券”查看</div>
      </div>
      <div class="imgQcBg" v-if="!clientTypeShow">
        <img :src="QRCODE || QRCODE_TEMP" class="imgPosiCss">
      </div>
      <div class="imgPosiBottomText" v-if="!clientTypeShow">
        {{QRCODEText || '关注T微信公众号'}}
      </div>
    </div>
  </template>
  <script setup>
  import { ref, onMounted,defineProps, reactive, toRefs, watch, computed } from 'vue';
  const props = defineProps({
    PrizeTotal:Number,
    PrizeList:Array,
    QRCODE:String,
    QRCODEText:String,
    Telephone:String
});
const clientType=TFF.common.ctx.getClientType()//设备类型
const title=ref('领取成功!')
const QRCODE_TEMP=ref('https://resource.teld.cn/teldimage/107/34e7f65000fd454e8d1807893317204e.png')//二维码
  onMounted(() => {
  
  });
  const clientTypeShow=computed(()=>{
    return TFF.common.ctx.CLIENT_TYPE.AliPay===clientType || TFF.common.ctx.CLIENT_TYPE.AliPay_SP===clientType
  })
  //数字保留1位小数
  const keepOneDecimal = (num,unit) => {
    if(unit=='元' && num == parseInt(num)){
      return num.toFixed(1);
    }
    return num
  }
  </script>
  <style scoped>
  .contentLeft{
    text-align: left;
  }
  .divAlignCenter{
    display: flex;
    align-items: center
  }
  .activityContentCss{
    margin-top: calc(100vw* 26 / 375);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
  }
  .titleCss{
    font-family: 'ZiHunBianTaoTi-2'!important;
    font-size: calc(100vw* 44 / 375);
    font-weight: 400;
    line-height: calc(100vw* 44 / 375);
    color: white;
  }
  .msgCss{
    box-sizing: border-box;
    width: calc(100vw* 323 / 375);
    margin-top: calc(100vw* 30 / 375);
    padding: calc(100vw* 12 / 375);
    border-radius:calc(100vw* 30 / 375);
    background: linear-gradient(180deg, #FF675F 0%, #FF2E3D 100%);
  }
  .msgTitle{
    line-height: calc(100vw* 20 / 375);
    font-size: calc(100vw* 14 / 375);
    font-weight: 600;
    color: #FFFFFF;
    /* font-family: 'HONORSansCN-Regular'!important; */
    margin-bottom: calc(100vw* 12 / 375);
  }
  .msgTitle span{
    color: #FFFB00;
  }
  .ticketCss{
    height: calc(100vw* 83 / 375);
    width: calc(100vw* 299 / 375);
    /* background-color: #FFFFFF; */
    border-radius:calc(100vw* 16 / 375);
    padding: calc(100vw* 16 / 375);
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: calc(100vw* 8 / 375);
    background: linear-gradient(90deg, #FFFFFF 0%, #FFE4E4 100%);
    border: solid 1px white;
  }
  .ticketCss .left{
    font-family: 'ZiHunBianTaoTi-2'!important;
    font-size: calc(100vw* 34 / 375);
    color: #FC474A;
    font-weight: 400;
  }
  .ticketCss .leftplus{
    /* font-family: 'ZiHunBianTaoTi-2'!important; */
    font-size: calc(100vw* 24 / 375);
    color: #FC474A;
    font-weight: 600;
  }
  .ticketCss .bottomMsg{
    /* font-family: 'HONORSansCN-Regular'!important; */
    color: #FC474A;
    font-weight: 400;
    font-size: calc(100vw* 12 / 375);
  }
  .ticketCssRight{
    /* font-family: 'HONORSansCN-Regular'!important; */
    color: #FC474A;
    font-weight: 600;
  }
  .ticketFontSize14{
    font-size: calc(100vw* 14 / 375);
  }
  .ticketFontSize20{
    font-size: calc(100vw* 20 / 375);
  }
  .ticketBottomMsg{
    /* font-family: 'HONORSansCN-Regular'!important; */
    color: #FFFFFFCC;
    font-weight: 400;
    font-size: calc(100vw* 12 / 375);
    margin-top: calc(100vw* 12 / 375);
  }
  .delectIcon{
    font-size: 10px;
    padding-left: 3px;
    padding-right: 3px;
  }
  .imgQcBg{
    margin-top: 30px;
    margin-bottom: 10px;
    width: calc(100vw* 100 / 375);
    height: calc(100vw* 100 / 375);
    border: 4px solid #F9CFA5;
    border-radius: calc(100vw* 12 / 375 + 8px);
    background-color: white;
    display: flex;
    justify-content: center;
    align-items: center;
  }

  .imgPosiCss{
    width: calc(100vw* 90 / 375);
    height: calc(100vw* 90 / 375);
    border-radius: 8px;
  }
  .imgPosiBottomText{
    /* font-family: 'HONORSansCN-Regular'!important; */
    color: #8B4F45;
    font-weight: 400;
    font-size: calc(100vw* 12 / 375);
    margin-bottom: 20px;
  }
  </style>